<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel=stylesheet href="css/style.css" type="text/css">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<title>Fantacalcio | Lista Squadre</title>
</head>
<body>
	<c:if test="${userInSession == null}">
		<c:redirect url="Logout.do"></c:redirect>
	</c:if>
		
	<c:import url="/head.jsp"/>
	
	<c:import url="/menu.jsp"/>
	
	<c:import url="menuSquadra.jsp"/>
	
	<div class="context">
		<h1> Lista Squadre </h1>
		<c:if test="${msg != null }">
			<div class="message">
				<span>${msg}</span>
			</div>
		</c:if>
		<display:table name="listaSquadra" requestURI="PrepareListSquadraAction.do" uid="table" class="tablesorter">
			<display:column property="nome" title="Nome" sortable="true"></display:column>
	  		<display:column property="crediti" title="Crediti" sortable="true"></display:column>
	  		<display:column property="presidente" title="Presidente" sortable="true"></display:column>
  			<display:column title="Azioni" sortable="false" >
  				<a href="PrepareCRUDSquadraAction.do?id=${table.id}&codOp=apri"> <img class="azioni" alt="apri" title="apri" src="images/open.png" /> </a>
  				<c:if test="${userInSession.role.codRole == 'ADMIN'}">
	  				<a href="PrepareCRUDSquadraAction.do?id=${table.id}&codOp=modifica"> <img class="azioni" alt="modifica" title="modifica" src="images/edit.png" /> </a>
	  				<a href="PrepareCRUDSquadraAction.do?id=${table.id}&codOp=cancella"> <img class= "azioni" alt="cancella" title="cancella" src="images/delete.png"> </a>
  				</c:if>
	  		</display:column>	
		</display:table>
	</div>
	
	<c:import url="/footer.jsp"/>

</body>
</html>